#include <algorithm>
#include <iostream>
using namespace std;

const int N = 2105;
long long f[N];
int primes[N], cnt;
bool st[N];

void get_primes(int n) {
    for (int i = 2; i <= n; ++i) {
        if (!st[i]) primes[++cnt] = i;
        for (int j = 1; primes[j] * i <= n; ++j) {
            st[primes[j] * i] = true;
            if (i % primes[j] == 0) break;
        }
    }
}

int main() {

    get_primes(2019);
    f[0] = 1;
    for (int i = 1; i <= cnt; ++i) {
        for (int j = 2019; j >= primes[i]; --j) {
            f[j] += f[j - primes[i]];
        }
    }
    cout << f[2019];

    return 0;
}